/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package rmi;

import java.rmi.AlreadyBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author modesto
 */
public class RMIServer implements Runnable {

    @Override
    public void run() {
        
        try {
            System.out.println("Starting RMI Server...");
            OpenRMTRMIInterface service = new OpenRMTRMIInterfaceImpl();
            Registry reg = LocateRegistry.createRegistry(11000);
            reg.bind("OpenRMTRMI", service);
        } catch (RemoteException ex) {
            Logger.getLogger(RMIServer.class.getName()).log(Level.SEVERE, null, ex);
        } catch (AlreadyBoundException ex) {
            Logger.getLogger(RMIServer.class.getName()).log(Level.SEVERE, null, ex);            
        }
        
        
    }
    
}
